home *** CD-ROM | disk | FTP | other *** search
/ Aminet 34 / Aminet 34 (2000)(Schatztruhe)[!][Dec 1999].iso / Aminet / comm / irc / cybershiela.lha / cs / csc_scramble.amirx < prev    next >
Text File  |  1999-10-08  |  3KB  |  127 lines

  1. /* shiela Online Games - letter scramble 1999 July - Zonkerz #amirc, #Starcafe Undernet
  2.    http://pages.cthome.net/amiga    http://www.starcafe.org  
  3. */
  4. Options Results  
  5. signal on syntax 
  6. ponger=getclip('SCRAMBLE')
  7. if ponger=1 then do;'say 5Word Scramble game already in progress...';exit;end
  8. call setclip('SCRAMBLE','1')
  9. 'say 5WoRd 4S3c9R4a9M3b4L9e 7V1.0'
  10. getusers
  11. allusers=result
  12.  
  13. call time('R')
  14. call loadscramble
  15.  
  16. SCRAMBLEWORD:
  17. kk=random(1,max,time('s'))
  18. correct=upper(u.kk)
  19. signal SCRAMBLEIT2
  20. COMEHERE:
  21. 'say 3the scrambled letters are: 6'messedup
  22. 'say 4!guess {word} 3to try to guess the word, You have 60 seconds to guess correctly.4!Pass3 ends this round.'
  23.  
  24. HuHuhLoopit:
  25. krv=time('E')
  26. if krv>60 then signal timeout
  27. if krv>40 & krv<50 then 'say 3You have less than 20 seconds remaining...'
  28. getmynick
  29. mynick=result
  30. 'userhost 'mynick
  31. myhost=result
  32. xxk=pos('@',myhost)
  33. myfront=substr(myhost,1,xxk-1)
  34. drop comm
  35. drop dest
  36. drop text
  37. drop prefix
  38. drop nick
  39. drop rest
  40. getchannel
  41. channam=Upper(result)
  42. 'getline'
  43. text=line 
  44. prefix=line.prefix 
  45. comm=line.command 
  46. dest=line.dest  
  47. rest=line.rest
  48.  
  49. xv=pos('!',prefix,1)
  50. if xv>0 then do;nick=left(prefix,xv-1);end
  51. msgr=nick
  52. if upper(left(comm,4))="PRIV" then signal PRIVMSG
  53. signal huhuhloopit
  54.  
  55. PRIVMSG: 
  56. getmynick
  57. mynick=upper(result)
  58. xv=pos('!',prefix,1)
  59. if xv>0 then do;nick=left(prefix,xv-1);end
  60.  
  61. BIG=upper(rest)
  62. xr=pos('!GUESS ',BIG)
  63. if xr>0 then signal GUESSWORD
  64.  
  65. BIG=upper(rest)
  66. xr=pos('!PASS',BIG)
  67. if xr>0 then do;'say 7Word has been Passed';signal TIMEOUT;end
  68.  
  69.  
  70. signal huhuhloopit
  71.  
  72.  
  73. GUESSWORD:
  74. guess2=word(big,2)
  75. guess=upper(guess2)
  76. if words(big)<2 then do;'say 3sorry 'nick' what were you saying?';signal huhuhloopit;end
  77. if guess=correct then do;'say 6Your Right 'nick'!';end
  78. if guess~=correct then do;'say 3Sorry 'nick' that is Incorrect.';signal huhuhloopit;end
  79. signal quit
  80. LOADSCRAMBLE:
  81. kk=1
  82. getprogdir
  83. dir=result
  84. config=dir||"/rexx/cs/wordscramble.db"
  85. if ~exists(config) then do;'echo c=3 p=CShiela Scramble File Not Found - Program Halted';call setclip('SCRAMBLE','0');exit;end
  86. call open(fle,config,'R')
  87. do until eof(fle)
  88. u.kk=readln(fle)
  89. kk=kk+1
  90. end
  91. max=kk-2
  92. call close(fle)
  93. return
  94.  
  95. Timeout:
  96. 'say 4BZZZZ No one guessed the word correctly...The word was 6'correct'.'
  97.  
  98.  
  99. quit:
  100. 'say 3Type 6!Scramble 3to Play Again.'
  101. call setclip('SCRAMBLE','0')
  102. exit
  103.  
  104.  
  105. /* Scrambling word tester */
  106. SCRAMBLEIT2:
  107. 'say 6ScRaMbLiNG the Word now....please wait...'
  108. word=correct
  109. wlen=length(word)
  110. wfill=""
  111. wempty=left(wfill,wlen,".")
  112. SCRAMBLEIT:
  113. do i=1 to wlen
  114. u.i=substr(word,i,1)
  115. end
  116. max=wlen
  117. i=1
  118. CARROT:
  119. p=random(1,wlen,time('s'))
  120. if substr(wempty,p,1)="." then do;wempty2=overlay(u.i,wempty,p,1);wempty=wempty2;i=i+1;end
  121. if i=max+1 then signal finishedword
  122. signal carrot
  123. FINISHEDWORD:
  124. messedup=wempty
  125. signal comehere
  126.  
  127.